<template>
    <div>
        <input type="text" v-model="mytext">
        <ul>
            <li v-for="data in computedList" :key="data">{{ data }}</li>
        </ul>
    </div>
</template>

<script>
import { reactive } from 'vue';
import UseSearch from './search'
//公认自定义hooks开头为 Use-开头

export default {
    setup() {
        const state = reactive({
            datalist: []
        })
        setTimeout(() => {
            state.datalist = ['aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff', 'ggg',]
        },2000)
        return {
            ...UseSearch(state)
        }
    }
}
</script>